/*
 * Ant Group
 * Copyright (c) 2004-2024 All Rights Reserved.
 */
package com.alipay.zmdepositdemo.util;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * swagger配置
 *
 * @author zhangjian
 * @version SwaggerConfig.java, v 0.1 2024年07月03日 09:57 zhangjian
 */
@Configuration
public class SwaggerConfig {
    @Bean
    public Docket defaultApi2() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(new ApiInfoBuilder()
                        .title("芝麻免押demo")
                        .description("芝麻免押demo文档")
                        .version("0.0.1")
                        .termsOfServiceUrl("https://opendocs.alipay.com/open/03w0a6/")
                        .build())
                // 设置分组名称
                .groupName("芝麻免押demo")
                .select()
                // 指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.alipay.zmdepositdemo.controller"))
                .paths(PathSelectors.any())
                .build();
    }

}